package c.h.a.b0;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView.e;
import androidx.recyclerview.widget.RecyclerView.z;
import com.liuzh.deviceinfo.DeviceInfoApp;
import com.liuzh.deviceinfo.appinfo.AppInfoActivity;
import java.util.ArrayList;
import java.util.List;

/* compiled from: AppListDialog */
public class j {
    public final Context a;
    public final List<String> b;
    public List<c.h.a.d0.a> c = new ArrayList();
    public a d;

    /* compiled from: AppListDialog */
    public class a extends e<a> {

        /* compiled from: AppListDialog */
        public class a extends z implements OnClickListener {
            public TextView t;
            public TextView u;
            public TextView v;
            public ImageView w;

            public a(View view) {
                super(view);
                this.t = (TextView) view.findViewById(2131296753);
                this.u = (TextView) view.findViewById(2131296798);
                this.v = (TextView) view.findViewById(2131297327);
                this.w = (ImageView) view.findViewById(2131296628);
                this.a.setOnClickListener(this);
            }

            public void onClick(View view) {
                c.h.a.d0.a aVar = (c.h.a.d0.a) j.this.c.get(e());
                if (aVar != null) {
                    AppInfoActivity.F(j.this.a, aVar.c);
                }
            }
        }

        public int a() {
            return j.this.c.size();
        }

        public void f(z zVar, int i) {
            a aVar = (a) zVar;
            c.h.a.d0.a aVar2 = (c.h.a.d0.a) j.this.c.get(i);
            if (aVar2 != null) {
                aVar.t.setText(aVar2.a);
                aVar.u.setText(aVar2.c);
                aVar.v.setText(aVar2.b);
                Drawable drawable = aVar2.d;
                if (drawable == null) {
                    drawable = null;
                    try {
                        drawable = aVar2.g.loadIcon(DeviceInfoApp.c.b());
                    } catch (OutOfMemoryError | SecurityException unused) {
                    }
                    if (drawable == null) {
                        aVar.w.setImageResource(17629184);
                        return;
                    }
                    aVar2.d = drawable;
                    aVar.w.setImageDrawable(drawable);
                    return;
                }
                aVar.w.setImageDrawable(drawable);
            }
        }

        public z g(ViewGroup viewGroup, int i) {
            return new a(LayoutInflater.from(viewGroup.getContext()).inflate(2131492972, viewGroup, false));
        }
    }

    public j(Context context, List<String> list) {
        this.a = context;
        this.b = list;
    }
}
